import logging
from config import config

def setup_logger(name: str) -> logging.Logger:
    print(f"[DEBUG] 进入函数: setup_logger")
    logging.baseConfig(
        level=config.LOG_LEVEL,
        format='%(asctime)s - %(levelname)s - %(message)s',
        handlers=[
            logging.FileHandler("web_monitor.log", encoding="utf-8"),
            logging.StreamHandler()
        ]
    )
    return logging.getLogger(name=name)